import request from '@/utils/request'

/**
 * 配送地址列表
 * @param {参数} params 
 */
export function queryList(params) {
    return request({
        url: '/sys/address/list',
        method: 'get',
        params
    })
}

/**
 * 配送地址下拉列表
 * @param {参数} params 
 */
export function querySelect(params) {
    return request({
        url: '/sys/address/select',
        method: 'get',
        params
    })
}

/**
 * 配送地址信息
 * @param {主键} id 
 */
export function queryInfo(id) {
    return request({
        url: `/sys/address/${id}`,
        method: 'get'
    })
}

/**
 * 新增配送地址
 * @param {数据} data 
 */
export function saveAddress(data) {
    return request({
        url: '/sys/address/save',
        method: 'post',
        data
    })
}

/**
 * 修改配送地址
 * @param {数据} data 
 */
export function updateAddress(data) {
    return request({
        url: '/sys/address/update',
        method: 'post',
        data
    })
}

/**
 * 删除配送地址
 * @param {主键} id 
 */
export function deleteAddress(id) {
    return request({
        url: `/sys/address/delete/${id}`,
        method: 'delete'
    })
}